﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>

<%

Set Rs = Server.CreateObject("Adodb.Recordset")

	dim rs,sql,i,name,act,page,fleg

    		act = Request("act")
    		Page = Request("page")      '当前页数
    		If Page = "" Then Page = 1
   		If Not IsNumeric(Page) Then Page = 1
    		Page = CLng(Page)
    		If Page < 1 Then Page = 1
	Set Rs = Server.CreateObject("Adodb.Recordset")
	if act="" then act=2

select case v
case "0"
we0="<br/>"
hr="-------------<br/>"
%>
<card title="帖子排序"><p align="<%=qingtian.px%>">
<%
case "1"
hr=""
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
%>
<title>帖子排序</title>
</head>
<body>
<!--#include virtual="/css.inc"-->
<%

End Select

		
%>
<%=qingtian.qingsav("40")%>
   <%

		if sid="Null" then
		%><%=dao%><%=zi%>欢迎你<%=zi0%><a href="/login.asp?sid=<%=sidd%>&amp;url=/bbs/newli.asp">注册/登陆</a><%=we0%><%
		else
		qingtian.info
		end if
if act=1 then
		%><%=dao%><a href="newli.asp?act=2&amp;sid=<%=sidd%>">新帖</a><%=zi%>.<%=zi0%><a href="newli.asp?act=3&amp;sid=<%=sidd%>">热帖</a><%=zi%>.<%=zi0%><a href="newli.asp?act=4&amp;sid=<%=sidd%>">精帖</a><%=zi%>.<%=zi0%>强帖<%=we0%><%=hr%><%
		elseif act=2 then
		%><%=dao%>新帖<%=zi%>.<%=zi0%><a href="newli.asp?act=3&amp;sid=<%=sidd%>">热帖</a><%=zi%>.<%=zi0%><a href="newli.asp?act=4&amp;sid=<%=sidd%>">精帖</a><%=zi%>.<%=zi0%><a href="newli.asp?act=1&amp;sid=<%=sidd%>">强帖</a><%=we0%><%=hr%><%
                elseif act=3 then
		%><%=dao%><a href="newli.asp?act=2&amp;sid=<%=sidd%>">新帖</a><%=zi%>.<%=zi0%>热帖<%=zi%>.<%=zi0%><a href="newli.asp?act=4&amp;sid=<%=sidd%>">精帖</a><%=zi%>.<%=zi0%><a href="newli.asp?act=1&amp;sid=<%=sidd%>">强帖</a><%=we0%><%=hr%><%
                else
		%><%=dao%><a href="newli.asp?act=2&amp;sid=<%=sidd%>">新帖</a><%=zi%>.<%=zi0%><a href="newli.asp?act=3&amp;sid=<%=sidd%>">热帖</a><%=zi%>.<%=zi0%>精帖<%=zi%>.<%=zi0%><a href="newli.asp?act=1&amp;sid=<%=sidd%>">强帖</a><%=we0%><%=hr%><%
		end if
		

		if act=1 then
		Sql = "select top 150 a.id,a.nid,a.listid,a.name,a.top,a.good,a.lock,a.bottom,a.browse,a.reply,a.vote,a.upfile,b.name,b.vip from [qingtian_bbs_forum] a,[qingtian_user] b where a.nid=b.id and a.del=0 order by a.reply desc"
		elseif act=2 then
		Sql = "select top 150 a.id,a.nid,a.listid,a.name,a.top,a.good,a.lock,a.bottom,a.browse,a.reply,a.vote,a.upfile,b.name,b.vip from [qingtian_bbs_forum] a,[qingtian_user] b where a.nid=b.id and a.del=0 order by a.id desc"
		elseif act=3 then
		Sql = "select top 150 a.id,a.nid,a.listid,a.name,a.top,a.good,a.lock,a.bottom,a.browse,a.reply,a.vote,a.upfile,b.name,b.vip from [qingtian_bbs_forum] a,[qingtian_user] b where a.nid=b.id and a.del=0 order by a.browse desc"
                else
		Sql = "select top 150 a.id,a.nid,a.listid,a.name,a.top,a.good,a.lock,a.bottom,a.browse,a.reply,a.vote,a.upfile,b.name,b.vip from [qingtian_bbs_forum] a,[qingtian_user] b where a.nid=b.id and a.del=0 and good=true order by a.id desc"

		end if


		Rs.Open Sql,conn,1,1



		if not (rs.bof and rs.eof)  then
				Rs.PageSize = 15	'一页N条记录
				IF Not IsEmpty(Page) Then
					IF Not IsNumeric(Page) Then		'判断Page是否为数字
						Page=1
					Else
						Page=Cint(Page)		'转换成短整形Integer
					End IF
					IF Page > Rs.PageCount Then
						Rs.AbsolutePage = Rs.PageCount	'设置当前显示页等于最后一页
					ElseIF Page <= 0 Then
						Rs.AbsolutePage = 1		'设置当前页等于第一页
					Else
						Rs.AbsolutePage = Page	'如果大于零,显示当前页等于接收的页数
					End IF
				Else
					Rs.AbsolutePage = 1
				End IF
				Page = Rs.AbsolutePage


		For i=1 to  Rs.PageSize
		If Rs.Eof Then
			exit For
		End If
dat=i+(page-1)*Rs.PageSize
%>			
<%=we%><%=dat%>.<a href="viewv.asp?id=<%=rs("id")%>&amp;pageid=<%=page%>&amp;listid=<%=rs("listid")%>&amp;sid=<%=sidd%>"><%=qingtian.ubb2(rs("a.name"))%></a><%=we0%><%=sou%>[<a href="/user/spacev.Asp?urls=/bbs/newli.asp&amp;nid=<%=rs("nid")%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("b.name"))%></a>/阅<%=zi%><%=rs("browse")%><%=zi0%>/回<a href="showboard.asp?infoid=<%=rs("id")%>&amp;pageid=<%=page%>&amp;listid=<%=listid%>&amp;sid=<%=sidd%>"><%=zi%><%=rs("reply")%><%=zi0%></a>]<%=we0%>
<%
			
	 	Rs.MoveNext
	  	Next

%>
<%=hr%>
<%
                if rs.PageCount>1 then
                    Response.Write dao
                end if
   		'分页

    		If Page < rs.PageCount Then
    		    Response.Write("<a href='newli.asp?act="&act&"&amp;page=" & Page + 1 & "&amp;sid="&sidd&"'>下页</a>")
    		End If
   		If Page > 1 Then
    		    Response.Write("<a href='newli.asp?act="&act&"&amp;page=" & Page - 1 & "&amp;sid="&sidd&"'>上页</a>")
    		End If
    		If Page < rs.PageCount Then
    		    Response.Write("<a href='newli.asp?act="&act&"&amp;page=" & rs.PageCount & "&amp;sid="&sidd&"'>末页</a>")
  		    Response.Write("("&Page&"/"&rs.PageCount&")"&we0&"")
                elseif rs.PageCount > 2 Then
    		    Response.Write("<a href='newli.asp?act="&act&"&amp;page=1&amp;sid="&sidd&"'>首页</a>")
  		    Response.Write("("&Page&"/"&rs.PageCount&")"&we0&"")
    		End If
    
    		If rs.PageCount > 2 Then
    		    Randomize()
                if v=0 then
     		    Response.Write("共"&rs.RecordCount&"条<input name='Page' format='*N' size='2' maxlength='5'/><anchor>GO&gt;&gt;<go href='newli.asp?act="&act&"&amp;sid="&sidd&"&amp;run="& Int((9999) * Rnd() + 1) &"' method='post'><postfield name=""Page"" value=""$(Page:n)"" /></go></anchor><br/>")
                else
     		    Response.Write("<form action=""newli.asp?act="&act&"&amp;sid="&sidd&"&amp;run="& Int((9999) * Rnd() + 1) &""" method=""post"">共"&rs.RecordCount&"条<input type=""text"" name=""Page"" value="""" format=""*N"" size=""2"" maxlength=""5""/><input type=""submit"" value=""GO&gt;&gt;"" /></form><br/>")
                end if
    		End If
		else
    		    %>
<%=we%>还没有发表过任何帖子！<%=we0%><%=hr%>
		<%
		end if
		Rs.close
	set rs=nothing

%>
<%=qingtian.qingsav("39")%>

<%
End Function
%>
